
<div class="transaction view">
<h2><?php echo 'Wallet'; ?></h2>
	<dl>
		<h4><?php echo 'Id'; ?></h4>
		<h4>
			<?php echo $transaction->id; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Category_id'; ?></h4>
                <h4>
			<?php echo $transaction->category_id; ?>
			&nbsp;
		</h4>
                <h4><?php echo 'Wallet_id'; ?></h4>
                <h4>
			<?php echo $transaction->wallet_id; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Name'; ?></h4>
		<h4>
			<?php echo $transaction->parent_id; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Current Money'; ?></h4>
		<h4>
			<?php echo $transaction->money; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Created'; ?></h4>
		<h4>
			<?php echo $transaction->created; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Updated'; ?></h4>
		<h4>
			<?php echo $transaction->updated; ?>
			&nbsp;
		</h4>
		<h4><?php echo 'Deleted'; ?></h4>
		<h4>
			<?php echo $transaction->deleted; ?>
			&nbsp;
		</h4>
                <h4><?php echo 'with_who'; ?></h4>
		<h4>
			<?php echo $transaction->with_who; ?>
			&nbsp;
		</h4>
	</dl>
</div>
<div class="actions">
	<h3><?php echo 'Actions'; ?></h3>
	<ul>
		<li><?php echo Html::anchor('transactions/ah4/','New transaction'); ?></li>
		
	</ul>
</div>

<?php if($transaction->categories->name=='Nợ' ||$transaction->categories->name=='Cho vay'){ ?>
<div class="related">
    
   
        <table cellpadding = "0" cellspacing = "0">
            <tr>
                <th><?php echo __('Đã trả'); ?></th>
                <th><?php echo __('Còn lại'); ?></th>
                
                <th class="actions"><?php echo __('Actions'); ?></th>
            </tr>
           
                <tr>
                    <td id="child_tr"><?php echo @$transaction->child_transaction->money; ?></td>
                    <td id="child_tr1"><?php 
                    $k=@$transaction->money- @$transaction->child_transaction->money;
                    if($k!=0)
                        {
                        echo $k;
                        } else{ echo 'Đã trả hết';}
                    
                    
                    
                    ?></td>
                    
                    <td class="actions">
                        <?php echo Html::anchor('transactions/view'.Session::get('userid'), 'View')?>
                        <?php echo Html::anchor('transactions/delete', 'Delete', array("onClick " =>" javascript:return confirm('Bạn muốn delete ?') ")); ?>
                    </td>
                </tr>
            
                
        </table>
    <?php echo Html::anchor('javascript:void(0)', 'Đã trả',array('id'=>'edit'))?>
    <div id="datra" style="display:none;">
        
        <fieldset>
            <?php echo Form::input('money') ; ?>
        </fieldset>
        <?php echo Form::submit(null,null,array('id'=>'smdatra')); ?>

    </div>


    
</div>
<?php } ?>

